Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracing #255

Merged
merged 18 commits into from
Jan 9, 2024
Merged

Add tracing #255

merged 18 commits into from
Jan 9, 2024

Conversation

rubdos
Copy link
Member

@rubdos rubdos commented Oct 13, 2023

No description provided.

@gferon
Copy link
Collaborator

gferon commented Oct 14, 2023

Let's switch the calls to the log crate at the same time, then?

@rubdos
Copy link
Member Author

rubdos commented Oct 14, 2023

Yeh, there's a reason it's a draft ^^

Don't know when I'll continue though.

Copy link

codecov bot commented Jan 6, 2024

Codecov Report

Attention: 88 lines in your changes are missing coverage. Please review.

Comparison is base (daad1fc) 3.63% compared to head (ce4ba97) 3.60%.

❗ Current head ce4ba97 differs from pull request most recent head bac7984. Consider uploading reports for the commit bac7984 to get more accurate results

Files Patch % Lines
libsignal-service-actix/src/push_service.rs 0.00% 20 Missing ⚠️
libsignal-service/src/websocket.rs 0.00% 16 Missing ⚠️
libsignal-service/src/cipher.rs 0.00% 14 Missing ⚠️
libsignal-service-actix/src/websocket.rs 0.00% 9 Missing ⚠️
libsignal-service-hyper/src/websocket.rs 0.00% 9 Missing ⚠️
libsignal-service-hyper/src/push_service.rs 0.00% 5 Missing ⚠️
libsignal-service/src/sender.rs 0.00% 5 Missing ⚠️
libsignal-service/src/envelope.rs 0.00% 4 Missing ⚠️
libsignal-service/src/attachment_cipher.rs 0.00% 2 Missing ⚠️
libsignal-service/src/groups_v2/operations.rs 0.00% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #255      +/-   ##
========================================
- Coverage   3.63%   3.60%   -0.04%     
========================================
  Files         37      37              
  Lines       2832    2860      +28     
========================================
  Hits         103     103              
- Misses      2729    2757      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rubdos
Copy link
Member Author

rubdos commented Jan 6, 2024

A cleaner trace for Envelopes would be beneficial:

2024-01-06 14:23:13 [INFO] decrypt; self=ServiceCipher { protocol_store: "...", csprng: "...", trust_root: "...", local_uuid: 9bad1xx, local_device_id: 1 } envelope=Envelope { r#type: Some(UnidentifiedSender), source_service_id: None, source_device: None, destination_service_id: Some("9bad"), timestamp: Some(170455xxx), content: Some([17, 10, 33, **LOADS MORE**, ...]), server_guid: Some("4d46a6"), server_timestamp: Some(17045509xxx), urgent: Some(false), story: Some(false), reporting_token: None }

@rubdos
Copy link
Member Author

rubdos commented Jan 8, 2024

image

This is looking pretty neat imo!

@rubdos rubdos requested a review from gferon January 8, 2024 13:44
@rubdos rubdos marked this pull request as ready for review January 8, 2024 13:45
@gferon
Copy link
Collaborator

gferon commented Jan 8, 2024

A cleaner trace for Envelopes would be beneficial:

2024-01-06 14:23:13 [INFO] decrypt; self=ServiceCipher { protocol_store: "...", csprng: "...", trust_root: "...", local_uuid: 9bad1xx, local_device_id: 1 } envelope=Envelope { r#type: Some(UnidentifiedSender), source_service_id: None, source_device: None, destination_service_id: Some("9bad"), timestamp: Some(170455xxx), content: Some([17, 10, 33, **LOADS MORE**, ...]), server_guid: Some("4d46a6"), server_timestamp: Some(17045509xxx), urgent: Some(false), story: Some(false), reporting_token: None }

Most definitely, let's impl tracing::Value for it!

@rubdos
Copy link
Member Author

rubdos commented Jan 8, 2024

Most definitely, let's impl tracing::Value for it!

Turns out that is pretty difficult :'-)

One needs to implement valuable::Valuable (Value itself is Sealed), but Valuable is quite the involved visitor pattern.

@rubdos
Copy link
Member Author

rubdos commented Jan 8, 2024

I'm pulling spans over await points, and I shouldn't be doing that in libsignal-service-actix/src/push_service.rs. Needs fixing.

@rubdos rubdos force-pushed the tracing branch 2 times, most recently from a5b86a1 to 5f5789a Compare January 8, 2024 20:03
@rubdos
Copy link
Member Author

rubdos commented Jan 9, 2024

I'm pulling spans over await points, and I shouldn't be doing that in libsignal-service-actix/src/push_service.rs. Needs fixing.

I fixed most of these, let's get this pulled in! Looks rather pretty imo :)

@rubdos rubdos enabled auto-merge January 9, 2024 10:32
@rubdos rubdos merged commit 036de0d into main Jan 9, 2024
11 checks passed
@rubdos rubdos deleted the tracing branch January 9, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants